import { Body, Controller, Delete, Get, Post, Put, Query } from '@nestjs/common';
import { CurriculumStructureService } from './curriculum_structure.service';

@Controller('curriculumStructure')
export class CurriculumStructureController {
    constructor(
        private readonly curriculumStructureService: CurriculumStructureService
    ) { }

    @Post('add')
    add(@Body() body: any) {
        return this.curriculumStructureService.add(body);
    }

    @Delete('delete')
    delete(@Body() body: any) {
        return this.curriculumStructureService.delete(body.id);
    }

    @Put('update')
    update(@Body() body: any) {
        return this.curriculumStructureService.update(body.id, body);
    }

    @Get()
    index(@Query() query: any) {
        return this.curriculumStructureService.findAll(query);
    }

    @Get('getCoursesByCategory')
    getCoursesByCategory(@Query() query: any) {
        return this.curriculumStructureService.getCoursesByCategory(query);
    }
}
